package com.fudan.sys.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.fudan.framework.base.BaseDao;
import com.fudan.sys.entity.Permission;


public interface PermissionDao extends BaseDao<Permission>{

	@Query(nativeQuery = true,value="select * from t_permission")
	public List<Permission> getPermissionList();

	@Query(nativeQuery = true,value="select * from t_role_permission rp join t_permission p on rp.permission_id=p.id where rp.role_id=:id")
	public List<Permission> getPermissionListByRoleId(@Param("id") Integer id);
}
